import java.util.Random;
import java.util.Scanner;

public class Dome02 {
    public static void main(String[] args) {
        Random random = new Random();
        Scanner scanner = new Scanner(System.in);
        int result = random.nextInt(10);
        while (true) {

            System.out.println("随机数生成完毕，开始竞猜");
            System.out.println("你猜的数字：");
            int i = scanner.nextInt();
            if (i == result) {
                System.out.println("对了");
                break;
            } else if (i < result) {
                System.out.println("小了");
            } else if (i > result) {
                System.out.println("大了");
            }
        }
    }
}
